import request from '@/utils/request'

// 获取员工简单列表API封装
export const getUserSimpleRequest = () => request.get('/sys/user/simple')

// 获取员工列表
export const getUserListRequest = params => request.get('/sys/user', { params })

// 新增员工
export const addUserListRequest = data => request.post('/sys/user', data)

// 删除员工
export const delUserListRequestById = id => request.delete(`/sys/user/${id}`)

// 批量导入员工  /sys/user/batch
export function batchUploadUserRequest(data) {
  return request({
    method: 'POST',
    url: `/sys/user/batch`,
    data
  })
}

// 获取员工基本信息
export function getUserInfoRequest(id) {
  return request({
    method: 'GET',
    url: `/sys/user/${id}`
  })
}

// 保存员工基本信息
export function updateUserInfoRequest(data) {
  return request({
    url: `/sys/user/${data.id}`,
    method: 'PUT',
    data
  })
}
